# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=swayrbar
pkgver=0.3.7
pkgrel=0
pkgdesc="A status command for Sway's swaybar"
url="https://sr.ht/~tsdh/swayr/"
arch="all"
license="GPL-3.0-or-later"
makedepends="cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~tsdh/swayr/archive/swayrbar-$pkgver.tar.gz"
builddir="$srcdir/swayr-swayrbar-$pkgver"

export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build -p swayrbar --release --frozen
}

check() {
	cargo test -p swayrbar --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
616e4f712c1356ba7002473dcdf91ca8b5e3765f571f2fdd3124b0acefe147a6b93ca614b34ce222eaeb9c2fb7bab9700112f838d0540b26d06c446b158fe139  swayrbar-0.3.7.tar.gz
"
